<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="input">
<script>
    const i = document.querySelector('#input')
    i.addEventListener('change',()=>{

    new Promise((resolve, reject)=>{
        if (i.value==='1'){
            resolve(i.value)
        }else {
            reject(i.value)
        }
    }).then((v)=>{
        console.log('111',v)
    }).catch((v)=>{
        console.log('222',v)
    })
    })
</script>
</body>
</html>